home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 2.00 Begin Form frmWhoIs Caption = "WhoIs Sample Program" ClientHeight = 5565 ClientLeft = 2985 ClientTop = 1785 ClientWidth = 9750 Height = 5970 Left = 2925 LinkTopic = "Form1" ScaleHeight = 5565 ScaleWidth = 9750 Top = 1440 Width = 9870 Begin MabryWhoIs WhoIs1 Blocking = -1 'True Host = "whois.internic.net" Left = 9240 Query = "" Top = 5040 End Begin TextBox txtQueryResults FontBold = 0 'False FontItalic = 0 'False FontName = "Courier New" FontSize = 8.25 FontStrikethru = 0 'False FontUnderline = 0 'False Height = 3255 Left = 240 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 10 Top = 2040 Width = 6135 End Begin TextBox txtQuery Height = 285 Left = 240 TabIndex = 9 Top = 480 Width = 6135 End Begin CommandButton cmdWhoIsQueryNonBlocking Caption = "WhoIs Query (Non-Blocking)" Height = 375 Left = 6720 TabIndex = 8 Top = 240 Width = 2775 End Begin CommandButton cmdWhoIsQueryBlocking Caption = "WhoIs Query (Blocking)" Height = 375 Left = 6720 TabIndex = 7 Top = 720 Width = 2775 End Begin CommandButton cmdExit Caption = "Exit WhoIs Sample" Height = 375 Left = 6720 TabIndex = 6 Top = 1320 Width = 2775 End Begin Label Label4 Caption = "Query Error Code:" Height = 215 Left = 240 TabIndex = 0 Top = 1080 Width = 1935 End Begin Label Label1 Caption = "WhoIs Query:" Height = 255 Left = 240 TabIndex = 1 Top = 240 Width = 1935 End Begin Label Label2 Caption = "Query Results:" Height = 255 Left = 240 TabIndex = 2 Top = 1800 Width = 1935 End Begin Label lblErrorNumber BorderStyle = 1 'Fixed Single Height = 285 Left = 240 TabIndex = 3 Top = 1320 Width = 6135 End Begin Label Label3 Caption = "This sample shows how to retrieve information about a particular host or net. WhoIs typically polls the database at the InterNIC. To try this sample, enter a host name into the WhoIs Query edit box. Then, press one of the WhoIs Query buttons. " Height = 1815 Left = 6720 TabIndex = 4 Top = 2040 Width = 2775 End Begin Label Label5 Caption = "For example, enter ""mabry.com"" into the WhoIs Query edit box. Then, press one of the query buttons. You'll see some technical information about our domain name come up in a few seconds." Height = 1335 Left = 6720 TabIndex = 5 Top = 3960 Width = 2775 End Option Explicit Sub cmdExit_Click () ' Get out. End End Sub Sub cmdWhoIsQueryBlocking_Click () Dim Index ' Clear results boxes. txtQueryResults.Text = "" lblErrorNumber.Caption = "" ' Start the query by getting the IP address ' of the InterNIC's WhoIs server. When this ' is complete, the rest of the query is ' handled by the WhoIs1_Done event ' event. Whois1.Blocking = True Whois1.Query = txtQuery.Text MousePointer = 11 Whois1.Action = 1 MousePointer = 0 ' Place all of the results into the Query ' results text box. For Index = 0 To Whois1.ResponseCount - 1 If Index <> 0 Then txtQueryResults.Text = txtQueryResults.Text & Chr(13) & Chr(10) End If txtQueryResults.Text = txtQueryResults.Text & Whois1.Response(Index) Next Index End Sub Sub cmdWhoIsQueryNonBlocking_Click () ' Clear results boxes. txtQueryResults.Text = "" lblErrorNumber.Caption = "" ' Start the query by getting the IP address ' of the InterNIC's WhoIs server. When this ' is complete, the rest of the query is ' handled by the WhoIs1_Done event ' event. On Error Resume Next Whois1.Blocking = False Whois1.Query = txtQuery.Text MousePointer = 11 Whois1.Action = 1 On Error GoTo 0 End Sub Sub WhoIs1_Done (ErrorCode As Integer) Dim Index lblErrorNumber = "Error code: " & ErrorCode ' If we handled this in blocking (synchronous) ' mode, skip the rest (no need for it). If Whois1.Blocking Then Exit Sub End If MousePointer = 0 ' Place all of the results into the Query ' results text box. For Index = 0 To Whois1.ResponseCount - 1 If Index <> 0 Then txtQueryResults.Text = txtQueryResults.Text & Chr(13) & Chr(10) End If txtQueryResults.Text = txtQueryResults.Text & Whois1.Response(Index) Next Index End Sub